Integrand size = 12, antiderivative size = 115 \[ \int e^x \cos \left (a+c x^2\right ) \, dx=-\frac {\sqrt [4]{-1} e^{\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \sqrt {\pi } \text {erf}\left (\frac {\sqrt [4]{-1} (1+2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}}+\frac {\sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt [4]{-1} (1-2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4561, 2266, 2235, 2236} \[ \int e^x \cos \left (a+c x^2\right ) \, dx=\frac {\sqrt [4]{-1} \sqrt {\pi } e^{-\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \text {erfi}\left (\frac {\sqrt [4]{-1} (1-2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}}-\frac {\sqrt [4]{-1} \sqrt {\pi } e^{\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \text {erf}\left (\frac {\sqrt [4]{-1} (1+2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}} \]
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 4561
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {1}{2} e^{-i a+x-i c x^2}+\frac {1}{2} e^{i a+x+i c x^2}\right ) \, dx \\ & = \frac {1}{2} \int e^{-i a+x-i c x^2} \, dx+\frac {1}{2} \int e^{i a+x+i c x^2} \, dx \\ & = \frac {1}{2} e^{-\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \int e^{\frac {i (1-2 i c x)^2}{4 c}} \, dx+\frac {1}{2} e^{\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \int e^{-\frac {i (1+2 i c x)^2}{4 c}} \, dx \\ & = -\frac {\sqrt [4]{-1} e^{\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \sqrt {\pi } \text {erf}\left (\frac {\sqrt [4]{-1} (1+2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}}+\frac {\sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 a+\frac {1}{c}\right )} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt [4]{-1} (1-2 i c x)}{2 \sqrt {c}}\right )}{4 \sqrt {c}} \\ \end{align*}
Time = 0.15 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.95 \[ \int e^x \cos \left (a+c x^2\right ) \, dx=\frac {\sqrt [4]{-1} e^{\left .-\frac {i}{4}\right /c} \sqrt {\pi } \left (-\text {erfi}\left (\frac {(-1)^{3/4} (i+2 c x)}{2 \sqrt {c}}\right ) (\cos (a)-i \sin (a))+e^{\left .\frac {i}{2}\right /c} \text {erfi}\left (\frac {\sqrt [4]{-1} (-i+2 c x)}{2 \sqrt {c}}\right ) (-i \cos (a)+\sin (a))\right )}{4 \sqrt {c}} \]
[In]
[Out]
Time = 0.31 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.75
method | result | size |
risch | \(\frac {\sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c +1\right )}{4 c}} \operatorname {erf}\left (\sqrt {i c}\, x -\frac {1}{2 \sqrt {i c}}\right )}{4 \sqrt {i c}}+\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c +1\right )}{4 c}} \operatorname {erf}\left (\sqrt {-i c}\, x -\frac {1}{2 \sqrt {-i c}}\right )}{4 \sqrt {-i c}}\) | \(86\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 260 vs. \(2 (73) = 146\).
Time = 0.26 (sec) , antiderivative size = 260, normalized size of antiderivative = 2.26 \[ \int e^x \cos \left (a+c x^2\right ) \, dx=\frac {\sqrt {2} {\left (\pi \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) - i \, \pi \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x + i\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) - \sqrt {2} {\left (\pi \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) + i \, \pi \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (-\frac {\sqrt {2} {\left (2 \, c x - i\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + \sqrt {2} {\left (-i \, \pi \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) - \pi \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x + i\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + \sqrt {2} {\left (-i \, \pi \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) + \pi \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (-\frac {\sqrt {2} {\left (2 \, c x - i\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right )}{4 \, c} \]
[In]
[Out]
\[ \int e^x \cos \left (a+c x^2\right ) \, dx=\int e^{x} \cos {\left (a + c x^{2} \right )}\, dx \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.87 \[ \int e^x \cos \left (a+c x^2\right ) \, dx=-\frac {\sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) + \left (i + 1\right ) \, \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x - 1}{2 \, \sqrt {i \, c}}\right ) + {\left (\left (i + 1\right ) \, \cos \left (\frac {4 \, a c + 1}{4 \, c}\right ) + \left (i - 1\right ) \, \sin \left (\frac {4 \, a c + 1}{4 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x + 1}{2 \, \sqrt {-i \, c}}\right )\right )}}{8 \, \sqrt {c}} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.10 \[ \int e^x \cos \left (a+c x^2\right ) \, dx=-\frac {i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\frac {1}{4} i \, \sqrt {2} {\left (2 \, x + \frac {i}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {4 i \, a c + i}{4 \, c}\right )}}{4 \, {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} + \frac {i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{4} i \, \sqrt {2} {\left (2 \, x - \frac {i}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {-4 i \, a c - i}{4 \, c}\right )}}{4 \, {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} \]
[In]
[Out]
Timed out. \[ \int e^x \cos \left (a+c x^2\right ) \, dx=\int {\mathrm {e}}^x\,\cos \left (c\,x^2+a\right ) \,d x \]
[In]
[Out]